<?php
$HTMLstr .= '<div class="body">
    <div class="findOne">
    <div class="findOneInside">';
$user = model_UserMapper::getCurrentUser();
$HTMLstr .= '<div class="findOneInsideImg">
    <img width="100%" src="stuff/images/saved/'. model_ConfigMapper::findAvatar($this->oneModel->getAvatar()) .'.jpg">
        </div>
        <div class="space"></div>
    <div class="fetchallOneInsideTitle">
    '. $this->oneModel->getName() .'
        <b>' . $this->oneModel->getUsername() . '</b>
            '. $this->oneModel->getSurname() .'
                </div>
                <div class="space"></div>';

if(null != $this->oneModel->getAbout()){
$HTMLstr .= '<div class="fetchallOneInsideTitle">
    О себе: '. $this->oneModel->getAbout() .'
        </div><div class="space"></div>';
}

$HTMLstr .= '<div class="fetchallOneInsideTitle">
    Возраст: ';
if(0 != $this->oneModel->getAge()){
$HTMLstr .= $this->oneModel->getAge();
} else {
    $HTMLstr .= 'не указан';
}
$HTMLstr .= '</div><div class="space"></div>';

if ('admin' == $user->getRole()){
$HTMLstr .= '<div class="fetchallOneInsideTitle">
    Роль: '. $this->oneModel->getRole() .'
        </div>
        <div class="space"></div>';
}

$HTMLstr .= '<div class="fetchallOneInsideTitle">
    Карма:
    <span id="vote_status">'. $this->oneModel->getKarma() .'</span>
        </div>';
        if ($user->getId() != $this->oneModel->getId()) {
    
    //================== карма счетчик
    $HTMLstr .= '<div class="fetchallOne" class="frame" style="width:auto">
        <button onclick="vote(1)"><img src="stuff/images/like.png" height="20px"></button>
        <button onclick="vote(2)"><img src="stuff/images/dislike.png" height="20px"></button>
        </div>';
    $HTMLstr .= '<script>setInterval("update()", 6000)</script>';
    //====================
} 
   $HTMLstr .= '<div class="space"></div>
        
    <div class="fetchallOneInsideAct">
    <a href="?controller=photo&action=index&user='. $this->oneModel->getId() .'">Смотреть фотографии</a>
        </div>
        <div class="space"></div>
        <div class="fetchallOneInsideAct">
    <a href="?controller=news&action=byUser&id='. $this->oneModel->getId() .'">Смотреть посты</a>
        </div><div class="space">';

if ($user->getId() != $this->oneModel->getId()) {
    $HTMLstr .= '
        <div class="fetchallOneInsideAct">
        <a href="?controller=message&action=edit&id='. $this->oneModel->getId() .'">Отправить личное сообщение</a>
            </div>';
} else {
    $HTMLstr .= '<div class="fetchallOneInsideAct">
        <a href="index.php?controller=user&action=edit&id='. $user->getId() .'">Изменить профиль</a>
            </div>';
}


if (1 != $this->oneModel->getId() && 'admin' == $user->getRole()) {
    if ('banned' != $this->oneModel->getRole()) {
        $HTMLstr .= '<div class="fetchallOneInsideAct">
            <a href="index.php?controller=user&action=ban&id='.$this->oneModel->getId().'">Забанить</a> ';
    } else {
        $HTMLstr .= '<div class="fetchallOneInsideAct">
            <a href="index.php?controller=user&action=unban&id='.$this->oneModel->getId().'">Разбанить</a> ';
    }
    $HTMLstr .= '<a href="index.php?controller=user&action=delete&id='.$this->oneModel->getId().'">Удалить</a>
        </div>
        <div class="head">
        (удаление юзера повлечет за собой каскадное удаление всех его новостей и комментариев)
        </div>';
}
$HTMLstr .= '<div class="space"></div>
    <div class="fetchallOneInsideTitle">
    <a href="index.php?controller=user">Ко всем юзерам</a>
    </div>
    </div>
    </div>
    </div>
    </div>';